<%@page import="model.CategoryModel"%>
<%@page import="model.SubCategoryModel"%>
<%@page import="entity.SubCategory"%>
<%@page import="entity.Category"%>
<%@page import="entity.News"%>
<%@page import="java.util.List"%>
<%@page import="util.ResourceHelper"%>
<%
	request.setCharacterEncoding("UTF-8");
	Category cate = (Category) request.getAttribute("cate");
	SubCategoryModel subModel = new SubCategoryModel();
	String title =  ResourceHelper.getByAlias("chuyen-muc") + " : " + cate.getTitle() + " - " + ResourceHelper.getByAlias("luu-tru-tin");
	String description = ResourceHelper.getByAlias("description");
%>
<jsp:include page="/layout/header.jsp">	
	<jsp:param name="cate" value="<%=cate.getAlias() %>"/>
	<jsp:param name="title" value="<%=title %>"/>	
	<jsp:param name="keywords" value="<%=cate.getTitle() %>"/>
	<jsp:param name="description" value="<%=description %>"/>
</jsp:include>
            <div id="content">
                <div id="leftsidecontent">
                    <div class="box-wrap">
                        <div class="box-categories">
                            <%                            	                               
                                for (String string : cate.getSubCategory()) {
                                    List<News> list = (List<News>) request.getAttribute("list" + string);
                                    SubCategory sub = subModel.findByAlias(string);
                                    if (list.size() > 0) {
                            %>                                   
                            <div class="box-item">
                                <div class="box-item_inner" style="height: 260px">

                                    <h3 class="heading"><a href="/<%=cate.getAlias()%>/<%=sub.getAlias() %>"><%= sub.getTitle()%></a></h3>
                                    <ul>
                                        <%
                                            for (News news : list) {
                                        %>
                                        <li><a href="/<%=news.getAlias()%>.html"><%=news.getTitle()%></a></li>
                                        <%
                                            }
                                        %>                                                                        
                                    </ul>
                                    <a class="readmore" href="/<%=cate.getAlias()%>/<%=string%>"><%=ResourceHelper.getByAlias("xem-them") %></a>
                                </div>
                            </div>
                            <%
                                    }
                                }

                            %>                                                        
                            <div class="clearbreak"></div>                        
                        </div>                        
						 <jsp:include page="/element/last_week.jsp">	
                        	<jsp:param name="cate" value="<%=cate.getAlias() %>"/>	
						</jsp:include> 
                        <jsp:include page="/element/last_month.jsp">	
                        	<jsp:param name="cate" value="<%=cate.getAlias() %>"/>	
						</jsp:include>						
                    </div>
                </div>
                <div id="rightsidecontent">
                    <div class="box-wrap">
                        <jsp:include page="/element/search.jsp">	
                        	<jsp:param name="cate" value="<%=cate.getAlias() %>"/>	
						</jsp:include>
                        <jsp:include page="/element/latest_news.jsp">	
                        	<jsp:param name="cate" value="<%=cate.getAlias() %>"/>	
						</jsp:include>
						<jsp:include page="/element/hot_news.jsp">	
                        	<jsp:param name="cate" value="<%=cate %>"/>	
						</jsp:include>                    
                        <div class="clearbreak"></div>
                    </div>
                </div>
                <div class="clearbreak"></div>
            </div>
<jsp:include page="/layout/footer.jsp">	
	<jsp:param name="cate" value="<%=cate.getAlias()%>"/>	
</jsp:include>